package com.coocaa.ops.admin.v1.auth.sys.service;

import com.coocaa.ops.common.core.biz.auth.entity.SysRunEntity;
import com.coocaa.ops.common.core.biz.auth.entity.SysUserEntity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * @author tangminghong
 * @date 2020-06-10
 */
public interface ISysAuthorizeService {


    Map<String, Object> userLogin(HttpServletRequest request, HttpServletResponse response) throws Exception;

    /**
     * 退出
     *
     * @param request
     * @param response
     * @throws Exception
     */
    void logout(HttpServletRequest request, HttpServletResponse response) throws Exception;


    /**
     * 获取登录用户指定菜单的操作权限
     *
     * @param clzz
     * @param loginUser
     * @return
     */
    List<SysRunEntity> getMenuTools(Class<?> clzz, SysUserEntity loginUser);

    Map<String, Object> getEnvironment(HttpServletRequest request);

    /**
     * 获取指定菜单的操作权限
     *
     * @param menuElId
     * @param roles
     * @return
     */
    List<SysRunEntity> getMenuTools(String menuElId, List<Integer> roles);

    /**
     * 获取当前用户有权限的菜单列表
     *
     * @param user
     * @return
     */
    String getUserMenusByUser(SysUserEntity user);

}
